﻿using System.Windows.Controls;
using SpreadsheetGear.Windows.Controls;

namespace WorkbookDesigner.Addons.SpreadsheetEditor.UI
{
    /// <summary>
    /// UserControl1.xaml 的交互逻辑
    /// </summary>
    public partial class WpfBookView : UserControl
    {
        public WpfBookView()
        {
            InitializeComponent();
            workbookView.FormulaBar = formulaBar;
        }

        public WorkbookView TestView => workbookView;

        private void workbookView_CellEndEdit(object sender, CellEndEditEventArgs e)
        {
            e.RangeSelection.Cells[0, 0].Font.Color = e.Entry.StartsWith("=")
                ? SpreadsheetGear.Colors.Red
                : SpreadsheetGear.Colors.Black;
        }
    }
}
